Administrator Guide 2017
Output to CSV file

Output to CSV file exports the data from a form as a CSV file which can be imported into a spreadsheet or other data handling application. Data is produced in a readable form and can be opened in Notepad or other text application. Detailed parameters are explained below.

Main

Main screen for this action

*Description

A descriptive text to identify this action

*CSV location and file name Enter the folder name relative to the root output directory of your system as defined in the configuration file.  Typically this folder will be named according to the files to be stored here, for instance ‘XML files’, 'CSV files' or 'PDF files', and each form will be saved under a date and time stamp in this folder.  For more information see the document .
CSV transformation By default magic5 outputs CSV files in a standard format. Alternative formats can be created by magic5 support and they will then appear in this list.
Suppress output of extended information for photos (eg. GPS)

Tick this box if you do not wish photo exif information to be included within the XML files.

Advanced

Advanced parameters for this action

Path or URL prefix for attachments

Attachments (such as photos or signatures) are defined by path and filename.  However magic5 can force output to a different path or url defined here and attached to the front of the filename entered above.  For example, the attachment could be output to C:/attachments but the receiving application may need to refer to http://mysystem.com/signatures and this could be entered here.

Override root output folder

Instead of using the system root output folder, files can be saved in the folder specified here.  Enter the full path and filename.

Conditions

This action will only be triggered if the conditions below are met. Leave blank if it is always to be executed.

Condition (1)-(4) If you wish to only run an action in a particular situation then you can use these conditions to specify them. The action will only occur if both conditions are satisfied. Typical uses are to only run an action or display an item if a particular answer has been given to one of the answers on the template.
For more help on using Display Conditions view the how-to guide.
Disable action

Tick this box to unconditionally disable this action.  This is the same as inserting a display condition that will never be fulfilled (eg. resultValue;xxx;equals;999 where there is no unique name of xxx).

Custom condition using 'and/or'

The text box under “Conditions (advanced)” allows custom conditions. These are tested in addition to any simpler conditions above.

If simple and complex conditions are both added then it will “AND” them together but each can be used on their own.

 

  • Each individual condition is the same as before (see above and how-to guide), but must be enclosed in square brackets.
    [condition type;unique name;test type;value to test] for example [resultValue;Priority;equals;High]
  • or and and test two or more conditions. NB. These are case-sensitive, OR and AND will not work
    • parentheses (curved brackets) give precedence to conditions. For example, to make A and B or C less ambiguous, use either:
      • (A and B) or C
      • A and (B or C)
  •  nesting can be used:
    • Surround each condition with [ and ]
    • Use lower-case or and and
    • Explicitly set precedence using ( and )
    • for example
      • ([resultValue;Priority;equals;High] and [resultValue;City;equals;London]) or (([resultValue;City;equals;Manchester] or [resultValue;City;equals;Leeds]) and [resultValue;Priority;equals;Medium])

Post-action processing (advanced)

After an action has finished running a file can be executed on the server. This could be, for instance, a .exe or a .bat file. Typically this would be used to insert data into another system.

File name to run Enter the full path and filename here.  Ensure that it is correctly spelt and that the file extension (such as .exe or .bat) is also correct.
Command line to run If the file specified above requires additional information on its command line, please enter it here. Contact your magic5 expert for further help.
Folder to run from Enter the full path and folder name that the executable programme needs to be launched from.
URL Instead of running an executable file locally, an http request can be sent to the URL specified here. It can contain standard variables.
HTTP verb Choose the http verb to be sent with the request to the URL specified above.  If you do not know what this is, ask your magic5 expert.
HTTP request body This will be very different in different circumstances and probably needs to defined at the implementation stage. It can contain standard variables and may contain the data entered on the form.
See Also